package com.tienon.message.service;

import java.util.List;
import java.util.concurrent.Future;

import org.springframework.stereotype.Service;

import com.tienon.message.entity.Push_App;

import com.tienon.message.thread.LoadSendMsgTasks;
/**
 * 加载发送表服务
 * 包含app，短信，email等的任务处理
 * @author xiuye
 *
 */
@Service
public class LoadSendMsgService {

	/**
	 * 载入单个app发送表数据
	 * @param data
	 * @return
	 */
	public Future<Boolean> loadAppSendMsgTask(Push_App data){
		return LoadSendMsgTasks.loadAppSendMsgTask(data);
	}
	/**
	 * 载入多个app发送表数据
	 * @param datas
	 * @return
	 */
	public List<Future<Boolean>> loadAppSendMsgTasks(List<Push_App> datas){
		
		return LoadSendMsgTasks.loadAppSendMsgTasks(datas);
		
	}
	/**
	 * 关闭服务
	 */
	public void close(){
		LoadSendMsgTasks.closeTasks();
	}
	/**
	 * 重启服务
	 */
	public void rebootService(){
		LoadSendMsgTasks.openTasks();
	}
}
